import Api from '@/api/client/levels'
import i18n from "@/lang/index";
const modalConfig = {
  pageName: 'sys:user',
  dialog: {
    title: i18n.global.t("title.1"),
    width: 800,
    appendToBody: true,
    draggable: true,
    labelWidth: "auto",
  },
  formAction: (data) => {
    console.log('edit', data)
    return new Promise((resolve, reject) => {
      Api.put(data).then((s) => {
        console.log(s)
        resolve(s)
      }).catch((e) => {
        reject(e)
      })
    })
  },
  formItems: [
    {
      type: "input",
      label: "ID",
      prop: "id",
      attrs: {
        disabled: true
      },
    },
    {
      type: "input",
      label: i18n.global.t("label.64"),
      prop: "level",
      attrs: {
        disabled: true
      },
    },
    {
      type: "input",
      label: i18n.global.t("label.92"),
      prop: "name",
      attrs: {
        placeholder: i18n.global.t("hint.87"),
      },
    },
    {
      type: "input",
      label: i18n.global.t("label.93"),
      prop: "level_up_value",
      attrs: {
        placeholder: i18n.global.t("hint.88"),
      },
    },
    // {
    //   type: "input",
    //   label: i18n.global.t("label.94"),
    //   prop: "level_up_bonus",
    //   attrs: {
    //     placeholder: i18n.global.t("hint.89"),
    //   }
    // },
  ],
  formRules: {
    name: [{ required: true, message: i18n.global.t("hint.87"), trigger: "blur" }],
    level_up_value: [{ required: true, message: i18n.global.t("hint.88"), trigger: "blur" }],
    // level_up_bonus: [{ required: true, message: i18n.global.t("hint.89"), trigger: "blur" }]
  },
}

export default modalConfig
